package javaex;

import java.io.BufferedReader;
import java.io.*;
public class java_4 {
	/*
	public static void main(String[] args){
		//4.1
		int ken = 100;
		System.out.println("***** result *****");
		if((ken>>1) < 70)
			System.out.println((ken>>1) + " is less than 70");
	}*/
	/*
	public static void main(String[] args) throws java.io.IOException{
		//4.2
		int x;
		System.out.println("*****result*****");
		System.out.print("Input x == ?");
		x = System.in.read()-'0';
		if(x>0)
			System.out.println("x is greater than zero");
		else
			System.out.println("x is equal to or less than zero");
	}*/
	/*
	public static void main(String[] args){
		//4.3
		int x =10, y=4;
		int ken;
		System.out.println("***** result*****");
		ken = x & y;
		if(ken>0)
			System.out.println("(x&y) is +");
		else
			if(ken<0)
				System.out.println("(x&y) is -");
			else
				System.out.println("(x&y) is 0");
	}*/
	/*
	public static void main(String[] args) throws java.io.IOException{
		//4.4
		int jumsu;
		char hakjum;
		String iput;
		System.out.println("*****result*****");
		System.out.print("Input jumsu:");
		InputStreamReader kkk = new InputStreamReader(System.in);
		BufferedReader bbb = new BufferedReader(kkk);
		iput = bbb.readLine();
		jumsu = Integer.parseInt(iput);
		if(jumsu >= 90)
			hakjum = 'A';
		else if(jumsu >= 80)
			hakjum = 'B';
		else if(jumsu >= 70)
			hakjum = 'C';
		else if(jumsu >=60)
			hakjum = 'D';
		else
			hakjum = 'F';
		System.out.println("Hakjum :" + hakjum);
	}*/
	/*
	public static void main(String[] args) throws java.io.IOException{
		//4.5
		int jumsu;
		char hakjum;
		String input;
		System.out.println("***** result*****");
		System.out.print("Input Jumsu:");
		
		InputStreamReader kkk = new InputStreamReader(System.in);
		BufferedReader bbb = new BufferedReader(kkk);
		input = bbb.readLine();
		jumsu = Integer.parseInt(input);
		
		switch(jumsu/10)
		{
		case 10: hakjum = 'A'; break;
		case 9: hakjum = 'A'; break;
		case 8: hakjum = 'B'; break;
		case 7: hakjum = 'C'; break;
		case 6: hakjum = 'D'; break;
		default: hakjum = 'F'; break;
		}
		System.out.println("Hakjum : " + hakjum);
	}*/
	/*
	public static void main(String[] args){
		//4.6
		int n, hap;
		System.out.println("***** result *****");
		n = hap = 0;
		for(n=1; n<=100; n++)
			hap+=n;
		System.out.println("1+2+3+...+100 = " + hap+ "(for statement)");
		
		n=1;
		hap=0;
		while(n<=100){
			hap+=n;
			n++;
		}
		System.out.println("1+2+3+...+100 = " + hap +"(while statemant)");
		
		n=1;
		hap=0;
		do{
			hap+=n;
			n++;
		}while(n<=100);
		System.out.println("1+2+3+...+100 = " + hap +"(do-while statemant)");		
	}*/
	/*
	public static void main(String[] args){
		//4.7
		int i, j;
		System.out.println("***** result *****");
		for(i=1; i<10; i++){
			for(j=1; j<10; j++)
				System.out.println( i + " * " + j + " = " + i*j + " ");
			if(j==10)
				System.out.print("\n");
		}
	}*/
	/*
	public static void main(String[] args){
		//4.8
		int[] ken = {10, 20, 30, 40, 50};
		int i, ave, sum =0;
		System.out.println("***** result *****");
		for(i=0; i<5; i++)
			System.out.println("ken[" + i + "] =" + ken[i]);
		for(i=0; i<5; i++)
			sum += ken[i];
		ave = sum/5;
		System.out.println("sum ="+ sum);
		System.out.println("average =" +ave);
		System.out.println("\n***** result *****");
		
		int boo[] = new int[5];
		boo[0] =10;
		boo[1] =20;
		boo[2] =30;
		boo[3] =40;
		boo[4] =50;
		sum=0;
		ave=0;
		for(i=0; i<5; i++)
			System.out.println("boo[" + i + "] =" + boo[i]);
		for(i=0; i<5; i++)
			sum += boo[i];
		ave = sum/5;
		System.out.println("sum ="+ sum);
		System.out.println("average =" +ave);
	}*/
	public static void main(String[] args){
		//4.9
		String title[] ={"JAVA", "HTML", "   C   ", "TOTAL"};
		int jumsu[][] = {{77, 66, 88}, {90, 80, 100}, {65,75,85}};
		int i, j, total;
		System.out.println("***** result *****");
		for(i=0; i<title.length; i++)
			System.out.print(title[i]+ " ");
		System.out.println();
		for(i=0; i<3; i++)
		{
			total=0;
			for(j=0; j<3; j++)
			{
				System.out.print(jumsu[i][j] + "    ");
				total = total + jumsu[i][j];
			}
			System.out.println( total);
		}
	}
}
